onOptionsMenuClosed

Deprecated

androidx.activity.ComponentActivity now implements MenuHost, an interface that allows any component, including your activity itself, to add menu items by calling addMenuProvider without forcing all components through this single method override. The MenuProvider interface uses a single onCreateMenu method for managing both the creation and preparation of menu items. Replace usages of this method with one or more calls to addMenuProvider in your Activity's onCreate method, overriding onMenuClosed to delegate menu closing to the individual MenuProvider that created the menu.

This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).

Parameters

menu

The options menu as last shown or first initialized by onCreateOptionsMenu().